import sys

# sys.stdin  标准输入
# sys.stdout  标准输出
# sys.stderr  错误

s_in = sys.stdin  # input就是读取sys.stdin里的数据
# 1.
while True:
    content = s_in.readline()
    if content == '\n':
        break
    print(content)
# 2.
while True:
    content = s_in.readline().rstrip('\n')
    if content == '':
        break
    print(content)

sys.stdout = open('stdout.txt', 'w', encoding='utf8')  # 标准输出从屏幕改成了‘stdout.txt’
print('a')
print('b')

sys.stderr = open('stderr.txt', 'w', encoding='utf8')  # 标准错误输出从屏幕改成了‘stdout.txt’
print(1 / 0)
